const defaultState = {
    records: [],
    category: [],
    searchInfo: {},
    articleDetail: '',
    categoryList: [],
    draftTag: [],
    saveResult: false
}

export const ArticleReducer = (state = defaultState, action) => {
    let {type, payload} = action;
    switch (type) {
        case 'ARTICLE_LIST':
            return { ...state, articleList: payload }
        case 'FEATCH_DATA':
            return {...state,...payload}
        case 'FEATCH_ARTICLE':
            return {...state,articleDetail: payload}
        case 'SAVE_ARTICLE':
            return {...state, articleDetail: payload}
        default:
            return {...state}
    }
}